package com.example.myapplication.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.myapplication.model.Person;

import java.util.List;

@Dao
public interface PersonDao {
    @Insert
    void insertPerson(Person... people);

    @Update
    void updatePersom(Person... people);

    @Query("select * from person where id =:id")
    Person selectPerson(String id);

    @Query("select * from person order by id desc")
    LiveData<List<Person>> findAllLive();

    @Query("delete from person")
    void clear();


}
